package com.nth.rooster.core.utils;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.sql.Timestamp;
import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


public final class Utility {
	
	public static Object[] cloneArrayNullCheck(Object[] value) {
		return (value != null ? value.clone():value);
	}
	
	public static Date cloneDateNullCheck(Date inputDate) {
		return (inputDate != null ? new Date(inputDate.getTime()) : null);
	}
	public static java.sql.Date cloneDateNullCheckForSql(java.sql.Date inputDate) {
		return (java.sql.Date) (inputDate != null ? new java.sql.Date(inputDate.getTime()) : null);
	}
	public static Timestamp cloneTimestampNullCheck(Timestamp input) {
		return (input != null ? new Timestamp(input.getTime()) : null);
	}
	
	public static boolean nullAndEmptyCheck(Object obj) {

		if (obj != null && !"".equals(obj.toString().trim())) {
			return true;
		}

		return false;
	}
}
